//index.js
var qcloud = require('../../vendor/wafer2-client-sdk/index')
var config = require('../../config')
var util = require('../../utils/util.js')

//获取应用实例
const app = getApp()

Page({
  data: {
    category: [],
    currentType: 0,
    pagesize: 15,
    goodList: [],
    scrollHight: null
  },
  onLoad: function () {
    this.http(config.service.productList, this.bannerData)
  },
  http: function (url, callback) {

    wx.request({
      url: url,
      data: {
      },
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        callback(res.data.data)
      }
    })
  },

  bannerData: function (data) {
    this.setData({
      goodList: data
    })
  },
  toDetailsTap: function (e) {
    var id = e.currentTarget.dataset.id
    wx.navigateTo({
      url: '../goods-details/index?item=' + JSON.stringify(id)
    })
  },
  onShareAppMessage: function () {
    return {
      title: '腾坤酒业',
      path: '/pages/home/index'
    }
  }
})
